package com.example.administrator.ddmsdemo2;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity {
        static final String LodTag = "hello";
        private Button bt;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        Log.v(MainActivity.LodTag, "first -> onCreate");
        bt = (Button)findViewById(R.id.button01);
        bt.setOnClickListener(new ButtonOnClickListener());
    }

    private class ButtonOnClickListener implements View.OnClickListener {
        @Override
        public void onClick(View v) {
            Intent intent = new Intent();
            intent.setClass(MainActivity.this,Second.class);
            MainActivity.this.startActivity(intent);
        }
    }

    @Override
    protected void onDestroy() {
        Log.v(MainActivity.LodTag,"First -> onDestroy");
        super.onDestroy();
    }

    @Override
    protected void onPause() {
        Log.v(MainActivity.LodTag,"First -> onPause");
        super.onPause();
    }

    @Override
    protected void onRestart() {
        Log.v(MainActivity.LodTag,"First -> onRestart");
        super.onRestart();
    }

    @Override
    protected void onResume() {
        Log.v(MainActivity.LodTag,"First -> onResume");
        super.onResume();
    }

    @Override
    protected void onStop() {
        Log.v(MainActivity.LodTag,"First -> onStop");
        super.onStop();
    }
}
